<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title><?=L('login_title')?></title>
		<meta name="robots" content="noindex,nofollow">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="stylesheet" href="<?=Web_Path?>packs/layui/css/layui.css">
		<link type="text/css" rel="stylesheet" href="<?=Web_Path?>packs/mbupload/Huploadify.css?v=1.2" />
		<script src="<?=Web_Path?>packs/js/jquery.min.js"></script>
		<script src="<?=Web_Path?>packs/layui/layui.js"></script>
		<script src="<?=Web_Path?>packs/js/cscms.js"></script>
		<script type="text/javascript" src="<?=Web_Path?>packs/mbupload/jquery.Huploadify.js"></script>
		<script type="text/javascript">
		cscms.get_host();
		$(function(){
			$('#upload').Huploadify({
				auto:false,
				fileTypeExts:'*.mp3;*.mp4;',
				multi:true,
				fileSizeLimit:204800,
				formData:{"dir":"<?=$dir?>","key":"<?=$key?>","cid":"<?=$cid?>","sid":"<?=$sid?>"},
				fileObjName:'Filedata',
				showUploadedPercent:true,//是否实时显示上传的百分比，如20%
				showUploadedSize:true,
				removeTimeout:9999999,
				uploader:"<?=$upsave?>",
				onUploadStart:function(){
					
				},
				onInit:function(){
					
				},
				onUploadComplete:function(data,responseText){
					var info = JSON.parse(responseText);
					if(info.msg=='ok'){
						parent.$('#purl').val(info.url);
						cscms.layer.msg('恭喜您，上传成功',{icon:1});
					}else{
						cscms.layer.msg(responseText,{icon:2});
					}
					setTimeout(function(){
						var index = parent.layer.getFrameIndex(window.name);
						parent.layer.close(index);
					},1500);
				},
				onDelete:function(file){
					console.log('删除的文件：'+file);
					console.log(file);
				}
				});
			});
		</script>
	</head>
	<body style="padding: 0px 10px">
		<div id="upload"></div>
	</body>
	<script>
		cscms.init();
	</script>
</html>

